package com.winexpress.product;

import com.winexpress.entity.Category;
import com.winexpress.entity.Wine;
import com.winexpress.session.product.ProductSessionBean;
import com.winexpress.session.product.SearchSessionBean;
import java.util.List;
import javax.ejb.EJB;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;

@WebService(serviceName = "SearchManagementWS")
public class SearchManagementWS {

    @EJB
    private SearchSessionBean searchSessionBean;

    @WebMethod(operationName = "searchByCatgory")
    public List<Wine> searchByCategory(@WebParam(name = "category") String key) {
        List<Wine> list = searchSessionBean.searchByCategory(key);
        return list;
    }

    @WebMethod(operationName = "searchCatgory")
    public List<Category> searchCategory(@WebParam(name = "category") String key) {
        List<Category> list = searchSessionBean.searchCategory(key);
        return list;
    }

    @WebMethod(operationName = "searchByWineName")
    public List<Wine> searchByWineName(@WebParam(name = "key") String key) {
        List<Wine> list = searchSessionBean.searchByWineName(key);
        return list;
    }

    @WebMethod(operationName = "searchByCountry")
    public List<Wine> searchByCountry(@WebParam(name = "country") String key) {
        List<Wine> list = searchSessionBean.searchByCountry(key);
        return list;
    }

    @WebMethod(operationName = "searchByVarietal")
    public List<Wine> searchByVarietal(@WebParam(name = "varietal") String key) {
        List<Wine> list = searchSessionBean.searchByVarietal(key);
        return list;
    }

    @WebMethod(operationName = "searchByVintage")
    public List<Wine> searchByVintage(@WebParam(name = "vintage") String key) {
        List<Wine> list = searchSessionBean.searchByVintage(key);
        return list;
    }

    @WebMethod(operationName = "searchByRegion")
    public List<Wine> searchByRegion(@WebParam(name = "region") String key) {
        List<Wine> list = searchSessionBean.searchByRegion(key);
        return list;
    }

    @WebMethod(operationName = "searchByPrice")
    public List<Wine> searchByPrice(@WebParam(name = "price") String key) {
        List<Wine> list = searchSessionBean.searchByPrice(key);
        return list;
    }
}
